﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Game.aspx.cs" Inherits="GalGame._Default"
    EnableViewState="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Css/UI/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" />
    <link href="Css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        //parent
        var config = parent.config;
        var Tool = parent.Tool;
        var $obj = function (id) { return document.getElementById(id); }
        var $stopPropagation = parent.$stopPropagation;
    </script>
    <script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.12.custom.min.js" type="text/javascript"></script>
    <script src="Scripts/log.js" type="text/javascript"></script>
    <script src="Scripts/audio.js" type="text/javascript"></script>
    <script src="Scripts/textbox_canvas.js" type="text/javascript"></script>
    <script src="Scripts/cg_canvas.js" type="text/javascript"></script>
    <script src="Scripts/peopleHead_canvas.js" type="text/javascript"></script>
    <script src="Scripts/write.js" type="text/javascript"></script>
    <script type="text/javascript">
        //class
        var gameWrite = null;
    </script>
    <script type="text/javascript">
        function Init(load, xml) {
            gameWrite = new GameWrite(load, xml);
        }
        function Preload(xml) {
            gameWrite.Preload(xml);
        }
        function Next() {
            if (gameWrite.Next())
                gameWrite.Preload();
            else
                End();
        }
        function Show() {
            if (gameWrite.Write())
                Next();
        }
        var loadMask;
        function ShowMask(isLoading) {
            $obj("next_div").onclick = null;
            if (isLoading) {
                loadMask.dialog("open");
            }
        }
        function HideMask(isLoading) {
            $obj("next_div").onclick = Next;
            if (isLoading) {
                loadMask.dialog("close");
            }
            var _this = parent.document.getElementById("GameMain");
            if (_this.style.visibility == "hidden") {
                parent.ShowMain();
                return false;
            }
            return true;
        }
        function drawProgress(max, now, canvas) {
            if (!canvas) {
                canvas = $obj("loadingprogress_canvas");
            }
            Tool.drawProgress(canvas, 0, 0, canvas.width, canvas.height, max, now);
        }
        function SystemInfo(load) {
            $obj("CG_div").innerHTML = load.cgLoaded + "(" + config.cg + ")";
            $obj("People_div").innerHTML = load.peopleLoaded + "(" + config.people + ")";
            $obj("PeopleHead_div").innerHTML = load.peopleHeadLoaded + "(" + config.peopleHead + ")";
            $obj("Bgm_div").innerHTML = load.bgmLoaded + "(" + config.bgm + ")";
            $obj("Voice_div").innerHTML = load.voiceLoaded + "(" + config.voice + ")";
        }

        function onload_page() {
            logManager.init();
            $("#clear_btn").button({ icons: { primary: "ui-icon-circle-close"} });
            loadMask = $("#loading_div").dialog({
                width: 300,
                height: 140,
                modal: true,
                autoOpen: false,
                resizable: false,
                dialogClass: "loading-dialog"
            });
        }
    </script>
    <script type="text/javascript">
        //END
        function End() {
            alert("游戏结束了，再次感谢您的试玩！");
        }
    </script>
</head>
<body onload="onload_page()">
    <div style="margin-left: auto; margin-right: auto; position: absolute">
        <table style="margin-top: 10px;">
            <tr>
                <td style="vertical-align: top; width: 250px;" class="Jui">
                    <div style="width: 250px; overflow: hidden">
                        <div id="leftmenu" style="margin-left: 250px">
                            <div id="log_div" style="width: 250px; border: 3px solid #6B162F; background-color: White;
                                padding: 5px;">
                                <button id="clear_btn" onclick="$('#log').empty()">
                                    clear log
                                </button>
                                <table>
                                    <tr>
                                        <td>
                                            CG:
                                        </td>
                                        <td>
                                            <div id="CG_div">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            People:
                                        </td>
                                        <td>
                                            <div id="People_div">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 80px">
                                            PeopleHead:
                                        </td>
                                        <td>
                                            <div id="PeopleHead_div">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Bgm:
                                        </td>
                                        <td>
                                            <div id="Bgm_div">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Voice:
                                        </td>
                                        <td>
                                            <div id="Voice_div">
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <div style="height: 200px; overflow: scroll">
                                    <table id="log">
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </td>
                <td style="vertical-align: top; height: 480px" class="Jui">
                    <button id="leftview_btn" style="height: 100%; width: 20px">
                        <<</button>
                </td>
                <td>
                    <div id="next_div" onclick="Next()" style="width: 640px; height: 480px; background-color: Black">
                        <canvas id="cg_canvas" width="640" height="480"></canvas>
                        <div style="margin-left: auto; margin-right: auto; margin-top: -110px; width: 600px">
                            <canvas id="text_canvas" width="600" height="90"></canvas>
                        </div>
                        <div style="margin-top: -180px; margin-left: 20px; width: 86px">
                            <canvas id="ph_canvas" width="86" height="89"></canvas>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div id="loading_div" title="loading..." class="msk">
        <p style="text-align: center">
            数据载入中请稍后，这可能需要一点时间。<br />
            <br />
            <canvas id="loadingprogress_canvas" height="15" width="250" />
        </p>
    </div>
</body>
</html>
